﻿@model CompareProductsModel
@using Nop.Core;
@using Nop.Core.Infrastructure;
@using Nop.Web.Models.Catalog;


<div id="flyout-comparelist">
    <div class="mini-comparelist">
        <div class="count">
            @if (Model.Products.Count == 0)
            {
                @T("ShoppingCart.Mini.NoItems")
            }
            else if (Model.Products.Count == 1)
            {
                @Html.Raw(string.Format(T("ShoppingCart.Mini.OneItemText").Text, string.Format("<a href=\"{0}\" class=\"items\">{1}</a>", Url.RouteUrl("ShoppingCart"), T("ShoppingCart.Mini.OneItem").Text)))
            }
            else
            {
                @Html.Raw(string.Format(T("ShoppingCart.Mini.SeveralItemsText").Text, string.Format("<a href=\"{0}\" class=\"items\">{1}</a>", Url.RouteUrl("ShoppingCart"), string.Format(T("ShoppingCart.Mini.SeveralItems").Text, Model.Products.Count))))
            }
        </div>

        @if (Model.Products.Count > 0)
        {
        <div class="items">
            <table>
                <tbody>
                    @for (int i = 0; i < Model.Products.Count; i++)
                    {
                        var item = Model.Products[i];
                        <tr class="item @(i == 0 ? "first" : null)">

                            <td class="picture">
                                <a href="@Url.RouteUrl("Product", new { SeName = item.Name })" title="@item.DefaultPictureModel.Title">
                                    <img alt="@item.DefaultPictureModel.AlternateText" src="@item.DefaultPictureModel.ImageUrl" title="@item.DefaultPictureModel.Title" />
                                </a>
                            </td>

                            <td class="product">
                                <div class="name">
                                    <a href="@Url.RouteUrl("Product", new { SeName = item.SeName })">@item.Name</a>
                                </div>
                                <div class="price">@T("ShoppingCart.Mini.UnitPrice"): @item.ProductPrice.Price</div>
                                
                            </td>

                            <td class="product-remove">
                                <p class="a-center">
                                    <input type="button" value="@T("Common.Remove")" title="@T("Common.Remove")" class="button-2 remove-button" onclick="AjaxCart.addproductvarianttocart('@Url.RouteUrl("RemoveProductFromCompareList", new { productId = item.Id })')" />
                                </p>
                            </td>

                        </tr>
                    }
                </tbody>
            </table>
        </div>
        <div class="clear">
        </div>
        }        
    </div>
</div>
